
#ifndef CROSSLINEITEM_H
#define CROSSLINEITEM_H

#include <BPointArray>
#include <BPolygon2Array>
#include <BGraphicItem>

using namespace BWE;

class CrossLineItem : public BGraphicItem
{
	BOBJECT(CrossLineItem);
public:
	CrossLineItem(BGraphicItem* parent = 0);
	~CrossLineItem();

protected:
	virtual void paint(BPainter& painter);

	virtual void freshEvent(const BEvent& event);

	virtual void mouseEnterEvent(const BMouseEvent& mouseEvent);
	virtual void mouseLeaveEvent(const BMouseEvent& mouseEvent);
	virtual void mousePressEvent(const BMouseEvent& mouseEvent);
	virtual void mouseReleaseEvent(const BMouseEvent& mouseEvent);
	virtual void mouseMoveEvent(const BMouseEvent& mouseEvent);

	virtual void mouseDoubleClickEvent(const BMouseEvent& mouseEvent);

private:
	BPointfArray	_linePoints;
	BPointf			_currentPos;
	int				_hoverIndex;
	int				_selectIndex;
	bool			_pressed;
	bool			_dirty;
	BPointfArray	_crossPoints;
};

#endif
